{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "9.写一个函数，这个函数能够将你输入的数字进行判断，若这个数字大于10的情况下，将这个数字减去8，得到的结果乘以2；若这个数字小于等于10的情况下，将这个数字平方"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "tips: 函数def fuc(): if else () **2"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "3\n"
     ]
    }
   ],
   "source": [
    "def func(n):\n",
    "    if n>10:\n",
    "        return n - 8\n",
    "    else:\n",
    "        return n**2\n",
    "print(func(11))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.5"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
